<?php
$totalcompnum = 0;
$baiwan5=0;
$baiwan8=0;
$baiwan10=0;
$qianwan2=0;
$hasincomenum = 0;
$morethanonehundredmillion = 0;
$morethanfiftymillion = 0;
$morethanthirtymillion = 0;
$morethantenmillion = 0;

//企业id
$totalcompnum_cid =array();
$baiwan5_cid =array();
$baiwan8_cid =array();
$baiwan10_cid =array();
$qianwan2_cid=array();
$hasincomenum_cid = array();
$morethanonehundredmillion_cid = array();
$morethanfiftymillion_cid = array();
$morethanthirtymillion_cid = array();
$morethantenmillion_cid = array();

if (!empty($data) && is_array($data)){
	foreach ($data as $_data){
		if($_data['comp_economics']['cid'] != ""){
			$income = $_data['comp_economics']['general_income'];
			if($income > 0 && $income<500){
				$baiwan5 += 1;
				$hasincomenum += 1;
				array_push($baiwan5_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}else if($income > 500 && $income<800){
				$baiwan8 +=1;
				$hasincomenum += 1;
				array_push($baiwan8_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}else if ($income > 800 && $income<1000){
				$hasincomenum += 1;
				$baiwan10+=1;
				array_push($baiwan10_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}else if($income >=1000 &&$income<2000){
				$morethantenmillion += 1;
				$hasincomenum += 1;
				array_push($morethantenmillion_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}else if($income >=2000 &&$income<3000){
				$qianwan2 += 1;
				$hasincomenum += 1;
				array_push($qianwan2_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}else if($income >=3000 &&$income<5000){
				$morethanthirtymillion += 1;
				$hasincomenum += 1;
				array_push($morethanthirtymillion_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}else if($income >=5000 &&$income<10000){
				$morethanfiftymillion += 1;
				$hasincomenum += 1;
				array_push($morethanfiftymillion_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}else if($income>=10000){
				$morethanonehundredmillion += 1;
				$hasincomenum += 1;
				array_push($morethanonehundredmillion_cid, $_data['comp_economics']['cid']); 
				array_push($hasincomenum_cid, $_data['comp_economics']['cid']); 
			}
			$totalcompnum += 1;
			array_push($totalcompnum_cid, $_data['comp_economics']['cid']);
		}
	}
}
$file_name = "企业产业化情况表";
$path=Router::url(array('controller' => '/', 'action' =>''), true);
?>
<?php if(empty($report)){?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2><?php echo $file_name;?></h2>
	</div>
    <?php
    	$url_explode=explode("group=", $_SERVER["QUERY_STRING"]);
    	echo '<div class="right back_btn">';
		echo $html->link("导出报表","/reports/compindustryreport/1?group=".$url_explode[1]);
		echo '</div>';
	?>
	<?php echo $this->element('reportgroup'); ?>
    <div class="clear"></div>
</div>
<?php }?>
<style>
.items_list table{
	color:black;
	font-size:12px;
	line-height:25px;
	text-align:center;
	border-collapse:collapse;
	border-style:solid;
	border-bottom:2px solid ;
}

.items_list table tr th{
	border-left:1px solid ;
	border-top:1px solid ;
	border-right:1px solid ;
	border-bottom:1px solid ;
}
.items_list table tr td{
	border-left:1px solid ;
	border-top:1px solid ;
	border-right:1px solid ;
	border-bottom:1px solid ;
}
.items_list table tr .th{
	border-left:2px solid ;
	border-top:2px solid ;
	border-right:2px solid ;
}

.items_list table tr .lth{
	border-left:2px solid ;
}

.items_list table tr .rth{
	border-right:2px solid ;
}
</style>
<div class="right_side_scollbar">
    <div class="detail_info_panel">
        <div class="items_list">
        	<table>
        		<tr>
        			<td>企业总数（家）</td>
        			<td>实现销售收入（家）</td>
        			<td>实现收入5百万以下（家）</td>
        			<td>实现收入5百万以上（家）</td>
        			<td>实现收入8百万以上（家）</td>
        			<td>实现收入1千万以上（家）</td>
					<td>实现收入2千万以上（家）</td>        			
        			<td>实现收入3千万以上（家）</td>
        			<td>实现收入5千万以上（家）</td>
        			<td>实现收入1亿以上（家）</td>
        		</tr>
				<tr>
				<?php //var_dump($totalcompnum_cid);exit
					implode("|",$totalcompnum_cid);
				?>
					<td><a href="<?php echo $path?>companys/index?show=1000&OwnedCompany=<?php echo  implode(",",$totalcompnum_cid)?>"><?php echo $totalcompnum;?></a></td>
					<td><a href="<?php  echo $path?>companys/index?show=1000&OwnedCompany=<?php  echo implode(",",$hasincomenum_cid)?>"><?php echo $hasincomenum;?></a></td>
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php echo  implode(",",$baiwan5_cid)?>"><?php echo $baiwan5;       ?></a></td>
					
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php echo  implode(",",$baiwan8_cid)?>"><?php echo $baiwan8;       ?></a></td>
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php echo  implode(",",$baiwan10_cid)?>"><?php echo $baiwan10;?></a></td>
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php echo  implode(",",$morethantenmillion_cid)?>"><?php echo $morethantenmillion;         //1千万?></a></td>
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php echo  implode(",",$qianwan2_cid)?>"><?php echo $qianwan2;                   //2千万?></a></td>	
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php  echo implode(",",$morethanthirtymillion_cid)?>"><?php echo $morethanthirtymillion;      //3千万?></a></td>
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php  echo implode(",",$morethanfiftymillion_cid)?>"><?php echo $morethanfiftymillion;       //5千万?></a></td>
					<td><a href="<?php echo  $path?>companys/index?show=1000&OwnedCompany=<?php echo  implode(",",$morethanonehundredmillion_cid)?>"><?php echo $morethanonehundredmillion;  //1亿?></a></td>
					
					

				</tr>
        	</table>
        </div>
    </div>
</div>
        	